<template>
  <q-layout view="lHh Lpr lFf">
    <q-layout-header>
      <q-toolbar
        color="primary"
        :glossy="$q.theme === 'mat'"
        :inverted="$q.theme === 'ios'"
      >
        <q-btn
          flat
          dense
          round
          @click="leftDrawerOpen = !leftDrawerOpen"
          aria-label="Menu"
          icon="menu"
        />

        <q-toolbar-title>
          Quasar App
          <div slot="subtitle">Running on Quasar v{{ $q.version }}</div>
        </q-toolbar-title>
      </q-toolbar>
    </q-layout-header>

    <q-layout-drawer
      v-model="leftDrawerOpen"
      :content-class="$q.theme === 'mat' ? 'bg-grey-2' : null"
    >
      <q-list
        no-border
        link
        inset-delimiter
      >
        <q-list no-border link inset-delimiter>
          <q-list-header>Dashboard</q-list-header>
          <q-item to="/admin" exact>
            <q-item-side icon="info_outline" />
            <q-item-main label="Dashboard" />
          </q-item>

          <q-item-separator />
          <q-list-header>活码</q-list-header>
          <q-item to="/admin/home">
            <q-item-side icon="home" />
            <q-item-main label="Home" />
          </q-item>
          <q-item to="/admin/about">
            <q-item-side icon="info_outline" />
            <q-item-main label="About" />
          </q-item>

          <q-item-separator />
          <q-list-header>用户</q-list-header>
          <q-item to="/admin/user-list">
            <q-item-side icon="info_outline" />
            <q-item-main label="用户列表" />
          </q-item>

          <q-item-separator />
          <q-list-header>Git</q-list-header>
          <q-item @click.native="openURL('https://gitee.com/ily69/wxQrCodeAdmin')">
            <q-item-side icon="school" />
            <q-item-main label="Git" sublabel="wx qrcode Admin"></q-item-main>
          </q-item>
        </q-list>
      </q-list>
    </q-layout-drawer>

    <q-page-container>
      <router-view />
    </q-page-container>
  </q-layout>
</template>

<script>
import { openURL } from 'quasar'

export default {
  name: 'LayoutAdminBase',
  data () {
    return {
      leftDrawerOpen: this.$q.platform.is.desktop
    }
  },
  methods: {
    openURL
  }
}
</script>

<style>
</style>
